Actor Shield_SMG : BrutalWeapon
{
	Tag "Sub-MachineGun with Shield"
	+Inventory.Undroppable
	Game Doom
	+BLOODSPLATTER
	Weapon.SelectionOrder 3500
	+WEAPON.WIMPY_WEAPON
	+WEAPON.NOAUTOAIM
	+WEAPON.NOALERT
	+WEAPON.CHEATNOTWEAPON
	Weapon.AmmoUse1 0 
	Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip1" //Reserve ammo type
	Weapon.AmmoType2 "BDSMGAmmo" //Magazine ammo type
	Obituary "%o was tickled by shielded %k's SMG." //Kill message
    AttackSound "None" //You better leave this clear
	//+WEAPON.NOAUTOFIRE
	Inventory.ForbiddenTo BDoomer, Sorcerer, Corvus
	States
	{
		Spawn:
			SMGZ A -1
			Stop
			
		Select:
			SHSG A 1 A_raise
			Wait
			
		Deselect:
			SHSG A 1 A_Lower
			Wait
			
		Ready:
		ReadyLoop:
			SHSG A 0 A_SetCrosshair(61)
			SHSG A 0 A_JumpIfInventory("Reloading",1,"reload") //Check if player wants to reload
			SHSG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			SHSG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			SHSG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			SHSG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			SHSG A 0 A_JumpIfInventory("Unloading",1,"Unload")
			SHSG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
			Loop
			
		Fire:
			SHSF A 0 A_JumpIfNoAmmo("NoAmmo")
			
			SHSF A 0 A_AlertMonsters
			SHSF A 0 A_FireCustomMissile("Tracer", 2, 0, 7, 5, 0, 0)
			
			SHSF A 0 A_PlaySound("FARSHT", 6)
			SHSF A 0 A_PlaySound("SMGFIRE", 1)
			SHSF A 0 A_ZoomFactor(0.99)
			
			SHSF A 1 Bright A_FireBullets(5, 3.5, 1, 17, "WeakPuff", FBF_NORANDOM | FBF_USEAMMO)
			
			"####" "#" 0 A_Takeinventory("BDSMGAmmo", 1)
			"####" "#" 0 A_Takeinventory("BDDualSMGAmmo", 1)
			
			"####" "#" 0 A_ZoomFactor(1.0)
			"####" "#" 0 A_Takeinventory("BDDualSMGAmmo", 1)
			SHSG B 1
			"####" "#" 0 A_FireCustomMissile("PistolCaseSpawn", 5, 0, 10, -2)
			SHSG A 1
			
			"####" "#" 0 A_SetPitch(pitch - 1.0)
			"####" "#" 0 A_JumpIfInventory("IsSorcerer", 1, 2)
			"####" "#" 0 A_SetPitch(pitch + 0.5)
			
			"####" "#" 0 A_ReFire
			Goto Ready
			
		Reload:
			"####" "#" 0 A_ZoomFactor(1.0)
			"####" "#" 0 A_TakeInventory("Zoomed", 1)
			"####" "#" 0 A_TakeInventory("ADSmode", 1)
			"####" "#" 0 A_TakeInventory("Reloading", 1)
			"####" A 0 A_JumpIfInventory("BDSMGAmmo", 41, "ReadyLoop")
			"####" A 0 A_JumpIfInventory("Clip1", 1, 1)
			Goto ReadyLoop
			"####" "#" 0 A_SetCrosshair(41)
			"####" "#" 0 A_JumpIfInventory("TurboReload", 1, "RefillTo40")
			"####" "#" 0 A_FireCustomMissile("EmptyClipSpawn", -5, 0, 8, -4)
			"####" "#" 0 A_PlaySound("SMGMOUT")
			PSRR ABCDEFGHIJKLMNOPQRSTUVWXYZ 1
			SMGG A 0 A_PlaySound("SMGMAGIN")
			PSRL ABCDEFGHIJKLMNOPQRST 1
			"####" "#" 0 A_JumpIfInventory("BDSMGAmmo", 1, "RefillTo41")
			Goto RefillTo40
			
		RefillTo40:
			"####" "#" 0 A_TakeInventory("Clip1", 1)
			"####" "#" 0 A_GiveInventory("BDSMGAmmo", 1)
			"####" "#" 0 A_GiveInventory("BDDualSMGAmmo", 1)
			"####" "#" 0 A_JumpIfInventory("BDSMGAmmo", 40, "ReadyLoop")
			"####" "#" 0 A_JumpIfInventory("Clip1", 1, "RefillTo40")
			Goto ReadyLoop
			
		RefillTo41:
			"####" "#" 0 A_TakeInventory("Clip1", 1)
			"####" "#" 0 A_GiveInventory("BDSMGAmmo", 1)
			"####" "#" 0 A_GiveInventory("BDDualSMGAmmo", 1)
			"####" "#" 0 A_JumpIfInventory("BDSMGAmmo", 41, "ReadyLoop")
			"####" "#" 0 A_JumpIfInventory("Clip1", 1, "RefillTo41")
			Goto ReadyLoop
			
		NoAmmo:
			SHSG A 0 A_JumpIfInventory("noautoreload", 1, 1)
			Goto Reload
			"####" "#" 0 A_JumpIfInventory("TurboReload", 1, "RefillTo40")
			"####" "#" 0 A_PlaySound("weapons/empty", 4)
			"####" A 5 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOPRIMARY)
			Goto ReadyLoop
			
		AltFire:
			TNT1 A 0
			"####" A 0 A_PlaySound("Paladin/MediumExert", 2)
			TNT1 A 0 A_PlaySound("WHOP")
			TNT1 A 0 A_JumpIfInventory("PunchCombo", 1, "Punch")
			TNT1 A 0 A_JumpIfInventory("SpecialAttackPunch", 1, "Punch")
			W01D ABCDEFGH 1
			TNT1 A 0 A_Custompunch(random(60,120),1,1,"BrutalAxePuff", 125)
			TNT1 A 0 A_ChangeFlag("SHIELDREFLECT", TRUE)
			TNT1 A 0 A_Giveinventory("ReadyToQuickSlash",1)
			W01D IJK 2 A_SpawnItemEx("ShieldDefense", 25,5,15,0,0,0,0,SXF_NOCHECKPOSITION,0)
			
		AltHold:
			"####" A 0
			"####" A 0 A_ChangeFlag("SHIELDREFLECT", TRUE)
			SHRS E 1 A_SpawnItemEx("ShieldDefense", 25,5,15,0,0,0,0,SXF_NOCHECKPOSITION,0)
			"####" A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
			"####" A 0 A_JumpIfInventory("Kicking",1,"KickRight")
			"####" A 0 A_JumpIfInventory("SpecialAttackPunch", 1, "Punch")
			SHRS E 1
			SHRS E 1 A_Refire
			SHRS DDCBA 1 A_WeaponReady
			Goto ReadyLoop
			
		Punch:
			TNT1 A 0 A_ChangeFlag("SHIELDREFLECT", TRUE)
			TNT1 A 0 A_TakeInventory("PunchCombo", 1)
			TNT1 A 0 A_Giveinventory("ReadyToQuickSlash",1)
			W01C A 1
			TNT1 A 0 A_PlaySound("WHOP")
			TNT1 A 0
			TNT1 A 0 SetPlayerProperty(0,1,0)
			W01C BC 2 //A_SpawnItemEx("ShieldDefense", 10,5,10,0,0,0,0,SXF_NOCHECKPOSITION,0)
			//TNT1 A 0 A_TakeInventory("SpecialAttackPunch2", 1)	// Doesn't do anything
			TNT1 A 0 A_Recoil(-12)
			TNT1 A 0 A_SpawnItemEx("ShieldDefense", 25,5,15,0,0,0,0,SXF_NOCHECKPOSITION,0)
			W01C D 1 A_FireCustomMissile("ShieldAttack", 0, 0, 0, -7)
			TNT1 A 0 A_JumpIfInventory("ShieldBashHappened",1,"BashConnect")
			W01C D 1 A_FireCustomMissile("ShieldAttack", 0, 0, 0, -7)
			TNT1 A 0 A_JumpIfInventory("ShieldBashHappened",1,"BashConnect")
			W01C E 1 A_FireCustomMissile("ShieldAttack", 0, 0, 0, -7)
			TNT1 A 0 A_JumpIfInventory("ShieldBashHappened",1,"BashConnect")
			W01C E 1 A_FireCustomMissile("ShieldAttack", 0, 0, 0, -7)
			TNT1 A 0 A_JumpIfInventory("ShieldBashHappened",1,"BashConnect")
			/*
			W01C F 0 A_FireCustomMissile("ShieldAttack", 40, 0, 0, -7)
			W01C F 0 A_FireCustomMissile("ShieldAttack", 20, 0, 0, -7)
			W01C F 0 A_FireCustomMissile("ShieldAttack", 0, 0, 0, -7)
			W01C F 0 A_FireCustomMissile("ShieldAttack", -20, 0, 0, -7)
			W01C F 0 A_FireCustomMissile("ShieldAttack", -40, 0, 0, -7)
			*/
		BashConnect:
			TNT1 A 0 SetPlayerProperty(0,0,0)
			W01C DCB 2
			TNT1 A 0 A_ChangeFlag("SHIELDREFLECT", FALSE)
			TNT1 A 0 A_TakeInventory("ShieldBashHappened",1)
			TNT1 A 0 A_GiveInventory("BashInhibitor",1)
			TNT1 A 0 A_JumpIfInventory("Kicking",1,"KickRight")
			W01C FGH 2 A_WeaponReady
			TNT1 A 0 A_JumpIfInventory("Kicking",1,"KickRight")
			Goto Ready
						
	}
}